pub mod ma;
pub mod smpr;

use serde::Deserialize;
use serde::Serialize;
use ts_rs::TS;

#[derive(Serialize, Deserialize, Debug, TS, PartialEq, Eq, Hash, Clone, Copy)]
#[ts(export)]
pub enum MaLineGroupKey {
    /// Exponential moving average family: EMA, DMA, TMA, DEMA, TEMA;
    ///DEMA Double Exponential Moving Average of specified length for timeseries of type ValueType
    DEMA,
    /// DMA	Simple shortcut for EMA over EMA
    DMA,
    /// EMA	Exponential Moving Average of specified length for timeseries of type ValueType
    EMA,
    ///HMA	Hull Moving Average for last length values for timeseries of type ValueType
    HMA,
    /// (Close) Linear regression moving average (LSMA);
    LSMA,
    /// (Volume) Linear regression moving average (LSMA);
    LSMAV,
    /// Running Moving Average (RMA);
    RMA,

    ///Simple moving average (SMA);
    SMA,
    /// Simple moving median (SMM);
    SMM,
    /// Symmetrically weighted moving average (SWMA);
    SWMA,

    /// Triple Exponential Moving Average of specified length for timeseries of type ValueType
    TEMA,
    /// Simple shortcut for EMA over EMA over EMA (or EMA over DMA, or DMA over EMA)
    TMA,
    /// Triangular Moving Average (TRIMA);
    TRIMA,

    /// Convolution Moving Average;
    /// Variable Index Dynamic Average (Vidya);
    VIDYA,

    /// Volume weighted moving average (VWMA);
    VWMA,

    /// Weighted moving average (WMA);
    WMA,

    /// Wilder’s Smoothing Average (WSMA);
    WSMA,
}

impl Default for MaLineGroupKey {
    fn default() -> Self {
        MaLineGroupKey::SMA
    }
}

// Using static with Mutex for potential interior mutability
lazy_static::lazy_static! {
    pub static ref MA_LINE_GROUP_KEYS : Vec<MaLineGroupKey>= vec![
    MaLineGroupKey::DEMA,
    MaLineGroupKey::DMA,
    MaLineGroupKey::EMA,
    MaLineGroupKey::HMA,
    MaLineGroupKey::LSMA,
    MaLineGroupKey::LSMAV,

    MaLineGroupKey::RMA,
    MaLineGroupKey::SMA,
    MaLineGroupKey::SMM,
    MaLineGroupKey::SWMA,
    MaLineGroupKey::TEMA,
    MaLineGroupKey::TMA,
    MaLineGroupKey::TRIMA,
    MaLineGroupKey::VIDYA,
    MaLineGroupKey::VWMA,
    MaLineGroupKey::WMA,
    MaLineGroupKey::WSMA,

    ];
}
